﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq;
using System.Linq.Expressions;
using System.Diagnostics;
using System.Data.Linq.Mapping;
using System.Collections;
using System.Reflection;
using System.Configuration;
using Commons.Data;
namespace Common.Background.Data
{
    /// <summary>
    /// 某个项目的数据库操作基类
    /// </summary>
    public abstract class BackgroundRepositoryBase : DbContextRepositoryBase
    {
        static string _conn;
        static BackgroundRepositoryBase()
        {
            if (ConfigurationManager.ConnectionStrings["Background"] == null)
                throw new Exception("请设置Background配置字符");
            else
                _conn = ConfigurationManager.ConnectionStrings["Background"].ToString();
        }
        public BackgroundRepositoryBase()
            : base(DbFactory.Intance(_conn, 3, 0))
        { }
    }
}
